package com.pet.server.po;

import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;

/**
 * PetInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "time_line")
public class PetTimeLine implements java.io.Serializable {

	// Fields

	private Integer id;
	private Integer petId;
	private String petName;
	private Integer userId;
	private String nickName;
	private String text;
	private String state;
	private Date createTime;

	// Constructors

	/** default constructor */
	public PetTimeLine() {
	}

	
	public PetTimeLine(Integer id, Integer petId, String petName,
			Integer userId, String nickName, String text, String state,
			Date createTime) {
		super();
		this.id = id;
		this.petId = petId;
		this.petName = petName;
		this.userId = userId;
		this.nickName = nickName;
		this.text = text;
		this.state = state;
		this.createTime = createTime;
	}


	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "text", nullable = false, length = 512)
	public String getText() {
		return text;
	}


	public void setText(String text) {
		this.text = text;
	}

	@Column(name = "state", nullable = false, length = 8)
	public String getState() {
		return state;
	}


	
	public void setState(String state) {
		this.state = state;
	}

	@Column(name = "pet_id", nullable = false)
	public Integer getPetId() {
		return this.petId;
	}

	public void setPetId(Integer petId) {
		this.petId = petId;
	}

	@Column(name = "user_id", nullable = false)
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Formula("(SELECT f.pet_name FROM pet_info f WHERE f.pet_id=pet_id)")
	@Column(name = "pet_name", nullable = false, length = 32)
	public String getPetName() {
		return this.petName;
	}

	public void setPetName(String petName) {
		this.petName = petName;
	}

	
	@Column(name = "create_time", nullable = false, length = 0)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Formula("(SELECT f.nick_name FROM user_info f WHERE f.user_id=user_id)")
	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	
	

}